package itd.newbee.mall.newbeemall.util;

/**
 * @author Administrator
 * @version 1.0
 * @description: TODO
 * @date 2025/3/10 20:56
 */
public class NumberUtil {
///    生成指定长度的随机数
    public static int genRandomNum(int length){
        int num = 1;
        double random = Math.random();
        if(random < 0.1){
            random = random + 0.1;
        }
        for(int i = 0;i < length;i++){
            num = num * 10;
        }
        return (int)(random * num);
    }
}
